﻿using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.VisualStudio.Modeling.Diagrams;

namespace RecentRunes.ObjectDiagram
{
    partial class CommentBoxShape
    {
        /// <summary>
        /// GeneratesDoubleDerived must be set, to be able to override this.
        /// </summary>
        /// <param name="shapeFields"></param>
        /// <param name="decorators"></param>
        protected override void InitializeDecorators(IList<ShapeField> shapeFields, System.Collections.Generic.IList<Decorator> decorators)
        {
            base.InitializeDecorators(shapeFields, decorators);

            TextField commentField = (TextField)ShapeElement.FindShapeField(shapeFields, "Comment");
            commentField.DefaultAutoSize = false; // auto-size not supported on multi-line text fields.
            commentField.DefaultMultipleLine = true;
            commentField.AnchoringBehavior.Clear(); // clear existing anchors, set up custom anchoring below.
            commentField.AnchoringBehavior.SetLeftAnchor(AnchoringBehavior.Edge.Left, 0.01);
            commentField.AnchoringBehavior.SetRightAnchor(AnchoringBehavior.Edge.Right, 0.01);
            commentField.AnchoringBehavior.SetTopAnchor(AnchoringBehavior.Edge.Top, 0.01);
            commentField.AnchoringBehavior.SetBottomAnchor(AnchoringBehavior.Edge.Bottom, 0.01);

            //Decorator decorator1 = new ShapeDecorator(commentField, ShapeDecoratorPosition.Center, PointD.Empty);
            //decorators.Add(decorator1);
        }
    }
}
